﻿@model RTracker.Areas.Recruitment.Models.Candidate.GCandidate

@{
    ViewBag.ValidatorCls = "validTxtCls";
    var IsDisabled = "";
    var DefaultClass = "gd-disabled-cls";
    if (ViewBag.IsDisabled == true && Model.Candidate.CandidateId != 0)
    {
        IsDisabled = "disabled";
    }

}


<form id="frm" class="form-horizontal mnt_form">
    <div class="form-body">
        @Html.HiddenFor(model => model.Candidate.CandidateId)
        @Html.HiddenFor(model => model.Candidate.CreatedBy)
        @Html.HiddenFor(model => model.Candidate.OrganizationId)

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.FirstName)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                               name="@Html.NameFor(model => model.Candidate.FirstName)"
                               placeholder="Enter @Html.DisplayNameFor(model => model.Candidate.FirstName)"
                               value="@(!Model.Candidate.FirstName.Trim().Equals(string.Empty) ? Model.Candidate.FirstName : "")">
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.MiddleName)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                               name="@Html.NameFor(model => model.Candidate.MiddleName)"
                               placeholder="Enter @Html.DisplayNameFor(model => model.Candidate.MiddleName)"
                               value="@(!Model.Candidate.MiddleName.Trim().Equals(string.Empty) ? Model.Candidate.MiddleName : "")">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.LastName)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                               name="@Html.NameFor(model => model.Candidate.LastName)"
                               placeholder="Enter @Html.DisplayNameFor(model => model.Candidate.LastName)"
                               value="@(!Model.Candidate.LastName.Trim().Equals(string.Empty) ? Model.Candidate.LastName : "")">
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.Department)</label>
                    <div class="col-md-9">
                        <select @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                                name="@Html.NameFor(model => model.Candidate.Department)">
                            @if (ViewBag.IsNew == true){ <option value=''>Select</option> }
                            @if (Model.LstDepartment != null)
                            {
                                foreach (var item in Model.LstDepartment)
                                {
                                    <option value="@item.DepartmentId" @(Model.Candidate.Department == item.DepartmentId ? "selected" : "")>@item.DepartmentName</option>
                                }
                            }
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.ContactAddress)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                               name="@Html.NameFor(model => model.Candidate.ContactAddress)"
                               placeholder="Enter @Html.DisplayNameFor(model => model.Candidate.ContactAddress)"
                               value="@(!Model.Candidate.ContactAddress.Trim().Equals(string.Empty) ? Model.Candidate.ContactAddress : "")">
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.EmailId)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                               name="@Html.NameFor(model => model.Candidate.EmailId)"
                               placeholder="Enter @Html.DisplayNameFor(model => model.Candidate.EmailId)"
                               value="@(!Model.Candidate.EmailId.ToString().Trim().Equals(string.Empty) ? Model.Candidate.EmailId.ToString() : "")">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.Mobile)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                               name="@Html.NameFor(model => model.Candidate.Mobile)"
                               placeholder="Enter @Html.DisplayNameFor(model => model.Candidate.Mobile)"
                               value="@(!Model.Candidate.Mobile.Trim().Equals(string.Empty) ? Model.Candidate.Mobile : "")">
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.Landline)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                               name="@Html.NameFor(model => model.Candidate.Landline)"
                               placeholder="Enter @Html.DisplayNameFor(model => model.Candidate.Landline)"
                               value="@(!Model.Candidate.Landline.ToString().Trim().Equals(string.Empty) ? Model.Candidate.Landline.ToString() : "")">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.Source)</label>
                    <div class="col-md-9">
                        <select @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                                name="@Html.NameFor(model => model.Candidate.Source)">
                            @if (ViewBag.IsNew == true){ <option value=''>Select</option> }
                            @if (Model.LstCandidateSource != null)
                            {
                                foreach (var item in Model.LstCandidateSource)
                                {
                                    <option value="@item.CandidateSourceId" @(Model.Candidate.Source == item.CandidateSourceId ? "selected" : "")>@item.CandidateSourceName</option>
                                }

                            }
                        </select>
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.ReferenceBy)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                               name="@Html.NameFor(model => model.Candidate.ReferenceBy)"
                               placeholder="Enter @Html.DisplayNameFor(model => model.Candidate.ReferenceBy)"
                               value="@(!Model.Candidate.ReferenceBy.ToString().Trim().Equals(string.Empty) ? Model.Candidate.ReferenceBy.ToString() : "")">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.Skills)</label>
                    <div class="col-md-9">
                        <input type="text" @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                               name="@Html.NameFor(model => model.Candidate.Skills)"
                               placeholder="Enter @Html.DisplayNameFor(model => model.Candidate.Skills)"
                               value="@(!Model.Candidate.Skills.ToString().Trim().Equals(string.Empty) ? Model.Candidate.Skills.ToString() : "")">
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label class="control-label col-md-3">@Html.DisplayNameFor(model => model.Candidate.Expirence)</label>
                    <div class="col-md-9">
                        <select @IsDisabled class="@ViewBag.ValidatorCls form-control @IsDisabled"
                                name="@Html.NameFor(model => model.Candidate.Expirence)">
                            @if (ViewBag.IsNew == true)
                            {
                            <option value=''>Select</option> }
                            @if (Model.LstVacancyExpirence != null)
                            {
                                foreach (var item in Model.LstVacancyExpirence)
                                {
                                    <option value="@item.VacancyExpirenceId" @(Model.Candidate.Expirence == item.VacancyExpirenceId ? "selected" : "")>@item.VacancyExpirenceName</option>
                                }

                            }
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
        <div class="col-md-6">
            <div class="form-group">
                <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.Candidate.CreatedByName)</label>
                <div class="col-md-9">
                    <input type="text" @IsDisabled placeholder="Enter Text" class="form-control @DefaultClass"
                           name="@Html.NameFor(model => model.Candidate.CreatedByName)"
                           value="@(!Model.Candidate.CreatedByName.Trim().Equals(string.Empty) ? Model.Candidate.CreatedByName : "")" disabled>
                </div>
            </div>
        </div>

        <div class="col-md-6">
            <div class="form-group">
                <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.Candidate.CreateTimestamp)</label>
                <div class="col-md-9">
                    <input type="text" @IsDisabled placeholder="dd-mm-yyyy" class="form-control @DefaultClass"
                           value="@(!Model.Candidate.CreateTimestamp.ToString().Trim().Equals(string.Empty) ? Model.Candidate.CreateTimestamp.ToString() : "")" disabled>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-6">
            <div class="form-group">
                <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.Candidate.ModifiedByName)</label>
                <div class="col-md-9">
                    <input type="text" @IsDisabled placeholder="Enter Text" class="form-control @DefaultClass"
                           name="@Html.NameFor(model => model.Candidate.ModifiedByName)"
                           value="@(!Model.Candidate.ModifiedByName.Trim().Equals(string.Empty) ? Model.Candidate.ModifiedByName : "")" disabled>
                </div>
            </div>
        </div>

        <div class="col-md-6">
            <div class="form-group">
                <label class="col-md-3 control-label">@Html.DisplayNameFor(model => model.Candidate.ModifiedTimestamp)</label>
                <div class="col-md-9">
                    <input type="text" @IsDisabled placeholder="dd-mm-yyyy" class="form-control @DefaultClass"
                           value="@(!Model.Candidate.ModifiedTimestamp.ToString().Trim().Equals(string.Empty) ? Model.Candidate.ModifiedTimestamp.ToString() : "")" disabled>
                </div>
            </div>
        </div>
    </div>

    <div class="clearfix"></div>
    <div class="form-actions fluid right">
        <div class="col-md-12">
            @if (ViewBag.IsNew == false)
            {
                <img style="float:left" src="~/Content/Images/hardLock_closedx50.png" title="Set Lock" alt="" id="btn-setHardLock-id" value="@Model.Candidate.CandidateId" class="cursor-pointer-cls @(Model.Candidate.IsHardLocked ? "gd-disabled-cls" : "" ) " @ViewBag.StrDisabled />
                <img style="float:left" src="~/Content/Images/hardLock_openx50.png" title="Release Lock" alt="" id="btn-releaseHardLock-id" value="@Model.Candidate.CandidateId" class="cursor-pointer-cls @(!Model.Candidate.IsHardLocked ? "gd-disabled-cls" : "") " @ViewBag.StrDisabled />
            }
            <img src="~/Content/Images/cancel.png" @ViewBag.StrDisabled id="btn-cancel-id" class="cursor-pointer-cls" />
            <img src="~/Content/Images/save.png" @ViewBag.StrDisabled id="btn-Save-id" class="cursor-pointer-cls" />
        </div>
    </div>
</form>
<script type="text/javascript">
    $(".datepicker-cls").each(function () {
        $(this).datepicker({ dateFormat: "dd-mm-yy" });
        //alert($(this).val().replace("-", "/").replace("-", "/").replace("-", "/"));
        $(this).datepicker("setDate", $(this).val());
    })



</script>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

